import java.util.Scanner;

public class a861 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String input ,output;
		String[] spInput;
		int h, w;
		int p;
		
		while(sc.hasNext()) {
			input = sc.nextLine();
			spInput = input.split(" ");
			
			h = Integer.parseInt(spInput[0]);
			w = Integer.parseInt(spInput[1]);
			
			p = ( ( 2 * h ) + ( 2 * w ) );
			
			output = Integer.toString(p);
			
			System.out.println(output);
		}
	}
	
}